<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<ActivateYourGlutes.Services.Model.Goal>" %>
<%@ Import Namespace="ActivateYourGlutes.Services.Model" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	View Goal
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<%
    var localeSettings = (UserLocaleSettings)ViewData["localeSettings"];
%>
    <div id="subheader">
        <h2>Goal</h2>
        <div>            
            <%= Html.ActionLink("Back to goals", MVC.Goal.Index()) %>
        </div>
    </div>
    <p>
        <%= ViewData.Model.ToString(localeSettings) %>
    </p>
<%
    if (ViewData.Model.Achieved)
    {
%>
    <p class="achieved">Achieved on <%= ViewData.Model.AchievedOn.Value.ToString(localeSettings.DateFormat) %></p>
<%
    }
%>
<%
    if (ViewData.Model.Active && !ViewData.Model.Achieved)
    {
        using (Html.BeginForm("Deactivate", null, null, FormMethod.Post, new { id = "entryForm"}))
        {
%>
    <p>
    <%=Html.AntiForgeryToken()%>
    <%=Html.Hidden("id", ViewData.Model.GoalId)%>
    <input type="submit" value="Deactivate" />
    </p>
<%
        }
    }
%>
    
</asp:Content>
